import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '@/views/login'
import Attention from "@/views/home/Attention";
import BrewingWine from "@/views/home/BrewingWine";
import Classification from "@/views/home/Classification";
import Personal from "@/views/home/Personal";
import Purchase from "@/views/home/Purchase";
import WineHistory from "@/views/home/WineHistory";
import Conversation from "@/views/home/Conversation";
import Layout from "@/components/Layout";
import Home from "@/components/Home";
import test from "@/api/test";
import register from "@/views/login/register";


Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    name: 'login',
    component: Login
  },
  {
    path: '/register',
    name: 'register',
    component: register
  },
  {
    path: '/test',
    name: 'test',
    component: test
  },
  {
    path: '/',
    name: 'Layout',
    component: Layout,
    redirect:'/Home',
    children:[
      {
        path:'/Home',
        // name: 'Home',
        component: Home,
      },
      {
        path:'/Attention',
        // name: 'Attention',
        component: Attention,
      },
      {
        path:'/BrewingWine',
        // name: 'BrewingWine',
        component: BrewingWine,
      },
      {
        path:'/Classification',
        // name: 'Classification',
        component: Classification,
      },
      {
        path:'/Conversation',
        // name: 'Conversation',
        component: Conversation,
      },
      {
        path:'/Personal',
        // name: 'Personal',
        component: Personal,
      },
      {
        path:'/Purchase',
        // name: 'Purchase',
        component: Purchase,
      },
      {
        path:'/WineHistory',
        // name: 'WineHistory',
        component: WineHistory,
      },
    ]
  },

]

const router = new VueRouter({
/*  mode:"history",
  base:process.env.BASE_URL,*/
  routes
})

export default router
